package cn.xorange.commons.core.auth.mapper;

import cn.xorange.commons.security.entity.SecurityMenu;
import cn.xorange.commons.security.entity.SecurityRole;
import cn.xorange.commons.security.entity.SecurityRolePermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author : yangjian
 * @date : 2023/2/9
 */
@Mapper
public interface UserPermissionMapper {

    List<SecurityRole> selectRoleByUserId(@Param(value = "tenantId") long tenantId,
                                          @Param("userId")Long userId);

    List<SecurityRolePermission> selectRolePermsByUserId(@Param(value = "tenantId") long tenantId,
                                        @Param("userId")Long userId);

    List<SecurityMenu> selectTenantRouterMenu(@Param(value = "tenantId") long tenantId,
                                              @Param(value = "userId") long userId,
                                              @Param("isAdmin") boolean isAdmin);

    List<SecurityMenu> selectRouterMenu(@Param(value = "tenantId") long tenantId,
                                        @Param(value = "userId") long userId,
                                        @Param("isAdmin") boolean isAdmin);


    List<SecurityMenu> selectSuperMenu();


}
